public class SportCar extends Car {

	private boolean isCabriolet;
	private double price;
	private boolean isTurboON;

	private SportCar(String model, String color, double price, int maxSpeed) {
		super(model, true, color, price, maxSpeed);
	}

	public SportCar(String model, String color, double price, int maxSpeed,
			boolean isCabriolet) {
		this(model, color, price, maxSpeed);
		setPrice(price);
		this.isCabriolet = isCabriolet;
		isTurboON = false;
	}

	protected void switchTurbo() {
		if (!isTurboON) {
			System.out.println("ON");
			isTurboON = true;
			return;
		} else {
			System.out.println("OFF");
			isTurboON = false;
			return;
		}
	}
	
	@Override
	protected void startEngine(){
		super.startEngine();
		this.switchTurbo();
	}

	protected boolean isCabriolet() {
		return isCabriolet;
	}

	protected void setPrice(double price) {
		if (price >= 0)
			this.price = price;
	}
	
	@Override
	public boolean equals(Object obj){
		if(this.getModel().equals(((SportCar) obj).getModel()))
		return true;
		return false;
	}

}
